package com.xgggh.redpack.ui.my.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;


import com.xgggh.redpack.R;
import com.xgggh.redpack.base.ui.BaseFragment;
import com.xgggh.redpack.databinding.ContentMyRedPackStatisticsBinding;


public class MyRedPackStatisticsFragment extends BaseFragment {
    ContentMyRedPackStatisticsBinding mBinding;
    public static MyRedPackStatisticsFragment newInstance() {
        return new MyRedPackStatisticsFragment();
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setHasOptionsMenu(true);
    }

    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
                             @Nullable Bundle savedInstanceState) {
        mBinding = DataBindingUtil.inflate(inflater, R.layout.content_my_red_pack_statistics, container, false);
        return mBinding.getRoot();
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        mBinding.twinklingRefreshLayout.setPureScrollModeOn();
        //redPackStatistics();
    }

   /* private  void redPackStatistics(){
        new MockMyRedPackService(getBaseActivity().getMockDelegate(MyRedPackService.class))
                //getService(RedPackService.class)
                .statistics()
                .compose(getBaseActivity().ioTransformer())
                .subscribe(new DisposableSubscriber<RedPackStatisticsRsp>() {
                    @Override
                    public void onNext(RedPackStatisticsRsp rsp) {
                        if (rsp==null || rsp.getData()==null){
                            // 没有数据，显示空界面，点击跳转发红包界面
                            return;
                        }
                        pie(rsp.getData());
                    }

                    @Override
                    public void onError(Throwable t) {
                        t.printStackTrace();
                    }

                    @Override
                    public void onComplete() {

                    }
                });
    }*/

}
